
<script>
  document.addEventListener("DOMContentLoaded", function() {
    // Select all paragraphs and divs containing text
    let textElements = document.querySelectorAll("p, div");

    textElements.forEach(element => {
        element.style.textAlign = "justify";
    });
});
</script>
<script>
  document.addEventListener("DOMContentLoaded", function() {
    // Create a <style> tag and add CSS rules
    let style = document.createElement("style");
    style.innerHTML = `
        p {
            text-align: justify;      /* Justify all paragraphs */
        }
        /* Indent only normal paragraphs, allowing italics */
        p:not(:has(strong, b), .no-indent) {
            text-indent: 2em;         /* Indent first line */
        }
        /* Exclude headings and centered paragraphs */
        h1, h2, h3, h4, h5, h6, p[style*="text-align:center"] {
            text-indent: 0 !important;
        }
    `;
    document.head.appendChild(style);
});
</script>